-- GENERATED SPELL FOR [Thaladred the Darkener] --


function spell0_20064(pUnit, Event) --@Psychic Blow,n/a--
pUnit:FullCastSpellOnTarget(36966,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20064', 539, 1)
end

function spell1_20064(pUnit, Event) --@Rend,n/a--
pUnit:FullCastSpellOnTarget(36965,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20064', 15000, 1)
end

function spell2_20064(pUnit, Event) --@Silence,Self--
pUnit:FullCastSpellOnTarget(30225,pUnit)
pUnit:RegisterEvent('Sorts_20064', 4271, 1)
end

function spell3_20064(pUnit, Event) --@Summon Player,n/a--
pUnit:FullCastSpellOnTarget(20477,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20064', 592, 1)
end

function Sorts_20064(pUnit, Event)
local choix_sorts_20064 = math.random(0, 3)
if choix_sorts_20064 == 0 then
pUnit:RegisterEvent('spell0_20064', 1, 1)
end
if choix_sorts_20064 == 1 then
pUnit:RegisterEvent('spell1_20064', 1, 1)
end
if choix_sorts_20064 == 2 then
pUnit:RegisterEvent('spell2_20064', 1, 1)
end
if choix_sorts_20064 == 3 then
pUnit:RegisterEvent('spell3_20064', 1, 1)
end
end

function mob20064_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20064', math.random(1500, 3000), 1)
end

function mob20064_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20064_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20064_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20064, 1, 'mob20064_Action')
RegisterUnitEvent(20064, 2, 'mob20064_Leave')
RegisterUnitEvent(20064, 3, 'mob20064_Kill')
RegisterUnitEvent(20064, 4, 'mob20064_Die')
